package com.da.javatest.niuke.baodian;

/**
 * @author chenlida
 * @date 2020/10/10 12:53
 * https://www.nowcoder.com/practice/d8acfa0619814b2d98f12c071aef20d4?tpId=8&tags=&title=&diffculty=0&judgeStatus=0&rp=1
 */
public class C46Parenthesis {
    public static boolean chkParenthesis(String A, int n) {
        while (A.length() > 0) {
            int length = A.length();
            A = A.replace("()", "");
            if (A.length() == length) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(chkParenthesis("(()())", 0));
        System.out.println(chkParenthesis("()a()()", 0));
        System.out.println(chkParenthesis("()(()()", 0));
    }
}
